#pragma once

#include <iostream>
#include <time.h>
#include<string>
#include<cstdio>

#define Info 0
#define Debug 1
#define Warning 2
#define Fatal 3

#define LOG(LEVEL, MESSAGE) log(#LEVEL, MESSAGE, __FILE__, __LINE__)

void log(std::string level, std::string message, std::string file, int line)
{
    time_t t = time(nullptr);
    struct tm *ctime = localtime(&t);

    std::cout << "[" << level << "]" << "[" << ctime->tm_year + 1900 << "-" << ctime->tm_mon + 1 << "-" << ctime->tm_mday << " "
              << ctime->tm_hour << ":" << ctime->tm_min << ":"<< ctime->tm_sec << "]" << " " 
              << "(" << file << " : " << line << ")"  << " "
              << message << std::endl;
}
